package com.aboverock.module.system.web;


import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.aboverock.common.domain.Result;
import com.aboverock.module.system.domain.Department;
import com.aboverock.module.system.service.DepartmentService;

import io.swagger.annotations.ApiOperation;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Rock Wang
 * @since 2018-07-26
 */
@RestController
@RequestMapping("system/department")
public class DepartmentController {
    @Autowired
    private DepartmentService departmentService;

    /**
     * 获取所有部门信息.
     *
     * @param request the request
     * @return 查询数据的结果列表
     */
    @ApiOperation(value = "获取所有部门信息")
    @GetMapping("all")
    public Result all(HttpServletRequest request) {
        List<Department> list = departmentService.list(null);
        return Result.success(list);
    }
}

